package com.kelaite.procurement.entity;

// Generated 2016-3-6 15:13:23 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;

/**
 * TPurchaseOrderExecution generated by hbm2java
 */
@Entity(name = "t_purchase_order_execution")
public class TPurchaseOrderExecution extends TBaseEntity {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id")
	private Long id;
	
	@ManyToOne(cascade=CascadeType.REFRESH,optional=false)
	@JoinColumn(name = "order_id")
	private TPurchaseOrder tPurchaseOrder;
	
	@Column(name = "order_no")
	private int orderNo;
	
	@Column(name = "order_execution_type")
	private boolean orderExecutionType;
	
	@Column(name = "confirm_time")
	private Date confirmTime;
	
	@ManyToOne(cascade=CascadeType.REFRESH,optional=false)
	@JoinColumn(name = "supplier_user_id")
	private TVendor tVendor;
	
	@ManyToOne(cascade=CascadeType.REFRESH,optional=false)
	@JoinColumn(name = "client_user_id")
	private TUser tUser;
	
	@Column(name = "doc1")
	private String doc1;
	@Column(name = "doc2")
	private String doc2;
	@Column(name = "doc3")
	private String doc3;
	@Column(name = "gmt_create_time")
	private Date gmtCreateTime;
	@Column(name = "gmt_update_time")
	private Date gmtUpdateTime;
	@Column(name = "extra_info")
	private String extraInfo;
	@Column(name = "created_by")
	private String createdBy;
	@Column(name = "updated_By")
	private String updatedBy;
	@Column(name = "is_delete")
	private boolean isDelete;
	
	@OneToMany(mappedBy="tPurchaseOrderExecution",cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@OrderBy(value = "id ASC")
	private Set<TPurchaseOrderExecutionItems> tPurchaseOrderExecutionItems = new HashSet<TPurchaseOrderExecutionItems>();

	public TPurchaseOrderExecution() {
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public TPurchaseOrder gettPurchaseOrder() {
		return tPurchaseOrder;
	}

	public void settPurchaseOrder(TPurchaseOrder tPurchaseOrder) {
		this.tPurchaseOrder = tPurchaseOrder;
	}

	public int getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(int orderNo) {
		this.orderNo = orderNo;
	}

	public boolean isOrderExecutionType() {
		return orderExecutionType;
	}

	public void setOrderExecutionType(boolean orderExecutionType) {
		this.orderExecutionType = orderExecutionType;
	}

	public Date getConfirmTime() {
		return confirmTime;
	}

	public void setConfirmTime(Date confirmTime) {
		this.confirmTime = confirmTime;
	}

	public TVendor gettVendor() {
		return tVendor;
	}

	public void settVendor(TVendor tVendor) {
		this.tVendor = tVendor;
	}

	public TUser gettUser() {
		return tUser;
	}

	public void settUser(TUser tUser) {
		this.tUser = tUser;
	}

	public String getDoc1() {
		return doc1;
	}

	public void setDoc1(String doc1) {
		this.doc1 = doc1;
	}

	public String getDoc2() {
		return doc2;
	}

	public void setDoc2(String doc2) {
		this.doc2 = doc2;
	}

	public String getDoc3() {
		return doc3;
	}

	public void setDoc3(String doc3) {
		this.doc3 = doc3;
	}

	public Date getGmtCreateTime() {
		return gmtCreateTime;
	}

	public void setGmtCreateTime(Date gmtCreateTime) {
		this.gmtCreateTime = gmtCreateTime;
	}

	public Date getGmtUpdateTime() {
		return gmtUpdateTime;
	}

	public void setGmtUpdateTime(Date gmtUpdateTime) {
		this.gmtUpdateTime = gmtUpdateTime;
	}

	public String getExtraInfo() {
		return extraInfo;
	}

	public void setExtraInfo(String extraInfo) {
		this.extraInfo = extraInfo;
	}

	public String getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public String getUpdatedBy() {
		return updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	public boolean isDelete() {
		return isDelete;
	}

	public void setDelete(boolean isDelete) {
		this.isDelete = isDelete;
	}

	public Set<TPurchaseOrderExecutionItems> gettPurchaseOrderExecutionItems() {
		return tPurchaseOrderExecutionItems;
	}

	public void settPurchaseOrderExecutionItems(
			Set<TPurchaseOrderExecutionItems> tPurchaseOrderExecutionItems) {
		this.tPurchaseOrderExecutionItems = tPurchaseOrderExecutionItems;
	}
	
}
